// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store/store'
import api from './public/api'
import https from './public/https'

Vue.prototype.api = api // 引入接口配置
Vue.prototype.https = https // 引入网络请求模块

Vue.config.productionTip = false


// 设置全局rem;
!(function(doc, win) {
  var docEle = doc.documentElement,//获取html元素
      event = "onorientationchange" in window ? "orientationchange" : "resize",//判断是屏幕旋转还是resize;
      fn = function() {
          var width = docEle.clientWidth;
          width && (docEle.style.fontSize = 50 * (width / 375) + "px");//设置html的fontSize，随着event的改变而改变。
      };
  win.addEventListener(event, fn, false);
  doc.addEventListener("DOMContentLoaded", fn, false);
}(document, window));

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
